import request from '@/utils/request'

export function listProvince(data) {
  return request({
    url: '/ims/province/list', method: 'get', params: data
  })
}

export function listCity(data) {
  return request({
    url: '/ims/city/list', method: 'get', params: data
  })
}

export function listGood(data) {
  return request({
    url: '/ims/product/page', method: 'get', params: data
  })
}

export function listGoodSku(data) {
  return request({
    url: '/ims/productSku/page', method: 'get', params: data
  })
}

export function addGood(data) {
  return request({
    url: '/ims/product', method: 'post', data: data
  })
}

export function updateGood(data) {
  return request({
    url: '/ims/product', method: 'put', data: data
  })
}

export function deleteGood(data) {
  return request({
    url: '/ims/product/' + data, method: 'delete'
  })
}

/**商品类别*/
export function listGoodType(data) {
  return request({
    url: '/ims/product/category/tree', method: 'get', params: data
  })
}

export function addGoodType(data) {
  return request({
    url: '/ims/product/category', method: 'post', data: data
  })
}

export function updateGoodType(data) {
  return request({
    url: '/ims/product/category', method: 'put', data: data
  })
}

export function deleteGoodType(data) {
  return request({
    url: '/ims/product/category/' + data, method: 'delete'
  })
}

/**库存管理*/

export function listStoreStock(data) {
  return request({
    url: '/ims/inventory/boardList/warehouse', method: 'get', params: data
  })
}

export function listGoodStock(data) {
  return request({
    url: '/ims/inventory/boardList/product', method: 'get', params: data
  })
}

/**库存记录*/
export function listStoreLog(data) {
  return request({
    url: '/ims/inventoryHistory/page', method: 'get', params: data
  })
}

/**仓库管理*/
export function listStore(data) {
  return request({
    url: '/ims/warehouse/page', method: 'get', params: data
  })
}

export function addStore(data) {
  return request({
    url: '/ims/warehouse', method: 'post', data: data
  })
}

export function updateStore(data) {
  return request({
    url: '/ims/warehouse/edit', method: 'post', data: data
  })
}

export function deleteStore(data) {
  return request({
    url: '/ims/warehouse/' + data, method: 'delete'
  })
}

/**品牌管理*/
export function listBrand(data) {
  return request({
    url: '/ims/productBrand/page', method: 'get', params: data
  })
}

export function addBrand(data) {
  return request({
    url: '/ims/productBrand', method: 'post', data: data
  })
}

export function updateBrand(data) {
  return request({
    url: '/ims/productBrand', method: 'put', data: data
  })
}

export function deleteBrand(data) {
  return request({
    url: '/ims/productBrand/' + data, method: 'delete'
  })
}

/**单位管理*/
export function listUnit(data) {
  return request({
    url: '/ims/merchant/page', method: 'get', params: data
  })
}

export function addUnit(data) {
  return request({
    url: '/ims/merchant/add', method: 'post', data: data
  })
}

export function updateUnit(data) {
  return request({
    url: '/ims/merchant/edit', method: 'post', data: data
  })
}

export function deleteUnit(data) {
  return request({
    url: '/ims/merchant/' + data, method: 'delete'
  })
}

/**入库管理*/
export function listInStore(data) {
  return request({
    url: '/ims/receiptOrder/page', method: 'get', params: data
  })
}

export function addInStore(data) {
  return request({
    url: '/ims/receiptOrder', method: 'post', data: data
  })
}

export function okInStore(data) {
  return request({
    url: '/ims/receiptOrder/warehousing', method: 'post', data: data
  })
}

export function updateInStore(data) {
  return request({
    url: '/ims/receiptOrder', method: 'put', data: data
  })
}

export function deleteInStore(data) {
  return request({
    url: '/ims/receiptOrder/' + data, method: 'delete'
  })
}

export function getInStoreDetail(data) {
  return request({
    url: '/ims/receiptOrder/' + data, method: 'get', params: data
  })
}

/**出库管理*/
export function listOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/page', method: 'get', params: data
  })
}

export function addOutStore(data) {
  return request({
    url: '/ims/shipmentOrder', method: 'post', data: data
  })
}

export function getOutStore(data) {
  return request({
    url: '/ims/shipmentOrderDetail/' + data, method: 'get', params: data
  })
}

export function okAddOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/shipment', method: 'post', data: data
  })
}

export function updateOutStore(data) {
  return request({
    url: '/ims/shipmentOrder', method: 'put', data: data
  })
}

export function deleteOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/' + data, method: 'delete'
  })
}

/**移库管理*/
export function listMoveStore(data) {
  return request({
    url: '/ims/movementOrder/page', method: 'get', params: data
  })
}

export function addMoveStore(data) {
  return request({
    url: '/ims/movementOrder', method: 'post', data: data
  })
}

export function updateMoveStore(data) {
  return request({
    url: '/ims/movementOrder', method: 'put', data: data
  })
}

export function deleteMoveStore(data) {
  return request({
    url: '/ims/movementOrder/' + data, method: 'delete'
  })
}

/**盘库管理*/
export function listCheckStore(data) {
  return request({
    url: '/ims/checkOrder/page', method: 'get', params: data
  })
}

export function addCheckStore(data) {
  return request({
    url: '/ims/checkOrder', method: 'post', data: data
  })
}

export function updateCheckStore(data) {
  return request({
    url: '/ims/checkOrder', method: 'put', data: data
  })
}

export function deleteCheckStore(data) {
  return request({
    url: '/ims/checkOrder/' + data, method: 'delete'
  })
}

/**仓位管理*/
export function listStoreSpace(data) {
  return request({
    url: '/ims/warehouse/space/page', method: 'get', params: data
  })
}

/** 客户下单*/
export function listCustomOrder(data) {
  return request({
    url: '/ims/customer/order/page', method: 'get', params: data
  })
}

export function getCustomOrder(data) {
  return request({
    url: '/ims/customer/order/detail/' + data, method: 'get'
  })
}

export function submitCustomOrder(data) {
  return request({
    url: '/ims/customer/order/submit', method: 'post', data: data
  })
}

export function deleteCustomOrder(data) {
  return request({
    url: '/ims/customer/order/cancel', method: 'post', data: data
  })
}

export function writeCustomOrder(data) {
  return request({
    url: '/ims/customer/order/write', method: 'post', data: data
  })
}

export function changeCustomOrder(data) {
  return request({
    url: '/ims/customer/order/store', method: 'post', data: data
  })
}

export function payCustomOrderPrice(data) {
  return request({
    url: '/ims/customer/order/cost', method: 'post', data: data
  })
}

export function payCustomOrder(data) {
  return request({
    url: '/ims/customer/order/paid', method: 'post', data: data
  })
}

export function listSaleOrder(data) {
  return request({
    url: '/ims/sale/order/page', method: 'get', params: data
  })
}

export function listSaleOrderLog(data) {
  return request({
    url: '/ims/order/history/page', method: 'get', params: data
  })
}

export function okSaleOrderBom(data) {
  return request({
    url: '/ims/customer/order/produce', method: 'post', data: data
  })
}

/** 生产订单*/
export function listProduceOrder(data) {
  return request({
    url: '/ims/produce/order/page', method: 'get', params: data
  })
}

export function approveOrder(data) {
  return request({
    url: '/ims/customer/order/review', method: 'post', data: data
  })
}

export function approveOrderNo(data) {
  return request({
    url: '/ims/customer/order/review/reject', method: 'post', data: data
  })
}

export function getProduceProcess(data) {
  return request({
    url: '/ims/process/flow/detail/' + data, method: 'get'
  })
}

export function getProduceUser(data) {
  return request({
    url: '/ims/produce/order/workers//' + data, method: 'get'
  })
}

/** 开始*/
export function startProduceOrder(data) {
  return request({
    url: '/ims/produce/order/begin', method: 'post', data: data
  })
}

/** 入库*/
export function storeProduceOrder(data) {
  return request({
    url: '/ims/produce/order/store', method: 'post', data: data
  })
}

/** 内围检查*/
export function reportProduceOrder(data) {
  return request({
    url: '/ims/produce/order/work/report', method: 'post', data: data
  })
}

/** 包装检查*/

/** 取消*/
export function cancelProduceOrder(data) {
  return request({
    url: '/ims/produce/order/cancel', method: 'post', data: data
  })
}

/** 重做*/

export function getProduceOrder(data) {
  return request({
    url: '/ims/produce/order/detail/' + data, method: 'get', params: data
  })
}

export function getOrderCode(data) {
  return request({
    url: '/ims/produce/order/generate/qrcode/image/' + data, method: 'get', params: data
  })
}

export function inStoreOrder(data) {
  return request({
    url: '/ims/receiptOrder/produce/insert', method: 'post', data: data
  })
}

export function getInStoreCode(data) {
  return request({
    url: '/ims/receiptOrder/generate/order/code', method: 'get', params: data
  })
}

/** 生成订单号（通用）*/
export function getCommonCode(data) {
  return request({
    url: '/ims/common/get/order/no', method: 'get', params: data
  })
}

/** 图纸管理*/
export function listGoodImg(data) {
  return request({
    url: '/ims/draw/template/page', method: 'get', params: data
  })
}

export function addGoodImg(data) {
  return request({
    url: '/ims/draw/template/save', method: 'post', data: data
  })
}

export function updateGoodImg(data) {
  return request({
    url: '/ims/draw/template/edit', method: 'post', data: data
  })
}

export function deleteGoodImg(data) {
  return request({
    url: '/ims/draw/template/delete', method: 'post', data: data
  })
}

export function listProduceBom(data) {
  return request({
    url: '/ims/produce/bom/item/getMaster', method: 'get', params: data
  })
}

/** 现货下单*/
export function listStoreOrder(data) {
  return request({
    url: '/ims/sale/bom/storesku', method: 'get', params: data
  })
}

/** 机智解析*/
export function getAddrMsg(data) {
  return request({
    url: '/ims/express/address/resolution', method: 'post', data: data
  })
}

/** 售后管理*/
export function listSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/page', method: 'get', params: data
  })
}

export function addSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/add', method: 'post', data: data
  })
}

export function getSaleAfterGood(data) {
  return request({
    url: '/ims/customer/order/items/' + data, method: 'get'
  })
}

export function cancelSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/cancel', method: 'post', data: data
  })
}

export function approveSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/review', method: 'post', data: data
  })
}

export function getSaleAfterLog(data) {
  return request({
    url: '/ims/aftersale/record/list', method: 'get', params: data
  })
}

export function writeSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/write', method: 'post', data: data
  })
}

export function confirmSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/receive', method: 'post', data: data
  })
}

export function paySaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/refund', method: 'post', data: data
  })
}

export function inSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/stored', method: 'post', data: data
  })
}

export function checkSaleAfter(data) {
  return request({
    url: '/ims/aftersale/order/check', method: 'post', data: data
  })
}

export function lisTaskCount(data) {
  return request({
    url: '/ims/task/list', method: 'post', data: data
  })
}

export function addSingLeGood(data) {
  return request({
    url: '/ims/customer/order/addSingle', method: 'post', data: data
  })
}
export function deleteSingLeGood(data) {
  return request({
    url: '/ims/customer/order/delSingle', method: 'post', data: data
  })
}
export function addAllBill(data) {
  return request({
    url: '/ims/recon/batch', method: 'post', data: data
  })
}
export function okAllPrint(data) {
  return request({
    url: '/ims/customer/order/print', method: 'post', data: data
  })
}
export function listAssignUser(data) {
  return request({
    url: '/system/user/drawlist', method: 'get', params: data
  })
}
export function okAssignUser(data) {
  return request({
    url: '/ims/customer/order/assign', method: 'post', data: data
  })
}
export function listCarModel(data) {
  return request({
    url: '/ims/sku/value/list', method: 'get', params: data
  })
}
